﻿using ReactiveUI;
using System.Reactive.Disposables;

namespace ScienceAIApp.Views;
/// <summary>
/// Interaction logic for SeriesDescriptionView.xaml
/// </summary>
public partial class SeriesDescriptionView
{
    public SeriesDescriptionView()
    {
        InitializeComponent();
        this.WhenActivated(_activated);
    }

    private void _activated(CompositeDisposable disposable)
    {

        // 文件夹打开command
        this.BindCommand(
            ViewModel, 
            vm => vm.OpenFolderCommand, 
            v => v.OpenFileBtn)
            .DisposeWith(disposable);

        // 显示历史记录
        this.BindCommand(
            ViewModel,
            vm => vm.ShowHistoryRecordCommand,
            v => v.HistorySeriesBtn
            ).DisposeWith(disposable);

        // 绑定加载的序列信息
        this.OneWayBind(
                ViewModel,
                vm => vm.CurrentSeriesName,
                v => v.CurrentSeriesName.Text)
            .DisposeWith(disposable);


    }
}
